<template>
    <div class="addEducation">
        <div>
            <el-form v-model="eduObj">
                <el-form-item label="年份" prop="pass">
                    <el-col :span="20">
                        <el-date-picker type="year" value-format="yyyy" placeholder="选择毕业年份" v-model="eduObj.year" style="width: 100%;"></el-date-picker>
                    </el-col>
                </el-form-item>
                <el-form-item label="学历" prop="pass">
                    <el-col :span="20">
                        <el-input type="text" v-model="eduObj.degree"></el-input>
                    </el-col>
                </el-form-item>
                <el-form-item label="学校" prop="pass">
                    <el-col :span="20">
                        <el-input type="text" v-model="eduObj.school"></el-input>
                    </el-col>
                </el-form-item>
                <el-form-item style="text-align: center">
                    <el-button type="primary" @click="addEducation">提交</el-button>
                </el-form-item>
            </el-form>
        </div>
    </div>

</template>

<script>
    import { addTeacherEducation } from '@/api/memberManage'
    export default {
        name: "addEducation",
        props:['educationInfo'],
        data(){
            return{
                teacherId: this.educationInfo,
                eduObj: {
                    year: '',
                    school: '',
                    degree: '',
                },
                eduList: [],
            }
        },
        methods:{
            async addEducation() {
                try {
                    await addTeacherEducation({
                        teacherid: this.teacherId,
                        educationList: [this.eduObj]
                    })
                    this.$message({
                        type: 'success',
                        message: '成功'
                    })
                    this.$emit('closeDialog')
                } catch (e) {
                    console.log(new Error(e))

                }
            },
        }
    }
</script>

<style lang="scss" scoped>
    .addEducation{
        .msTop{
            .imgSize{
                width: 50px;
                height: 50px;
            }
        }
        /deep/ .el-form-item {
            margin-bottom: 15px;
        }
        /deep/ .el-form-item__label {
            font-size: 14px;
        }
        /deep/ .el-input__inner, .el-textarea__inner, .textarea__inner {
            font-size: 12px;
        }
        .upload, .submit{
            font-size: 16px;
            background: #cccccc;
            height: 35px;
            width: 70px;
        }

        /deep/ .el-button--medium {
            font-size: 12px;
            /*margin-left: 10px;*/
        }

    }
</style>
